﻿using RuoVea.ExEnum;
using RuoVea.ExSugar.Entity;
using SqlSugar;

namespace BookMarks.Server.Models;

/// <summary>
/// 分类
/// </summary>
[SugarTable(nameof(BorCategory), "分类")]
public class BorCategory : EntityBase
{
    /// <summary>
    /// 
    /// </summary>  
    [SugarColumn(ColumnDescription = "上级", IsNullable = true)]
    public long PId { get; set; }
    /// <summary>
    /// Code
    /// </summary>
    [SugarColumn(ColumnDescription = "代码", IsNullable = false)]
    public string Code { get; set; }
    /// <summary>
    /// 名称
    /// </summary>
    [SugarColumn(ColumnDescription = "名称", IsNullable = false)]
    public string Name { get; set; }

    /// <summary>
    /// 状态-正常_0、停用_1 
    /// </summary>
    [SugarColumn(ColumnDescription = "是否禁用", IsNullable = true)]
    public YesOrNot? IsDisable { get; set; }
    /// <summary>
    /// 排序越大越靠后
    /// </summary>
    [SugarColumn(ColumnDescription = "排序", IsNullable = true)]
    public int Sort { get; set; }
    /// <summary>
    /// 推送线上
    /// </summary>
    [SugarColumn(ColumnDescription = "推送线上", IsNullable = true)]
    public int PutLine { get; set; }
    /// <summary>
    /// 内容
    /// </summary>
    [SugarColumn(ColumnDescription = "备注", IsNullable = true)]
    public string Remark { get; set; }

    /// <summary>
    /// 类别子项
    /// </summary>
    [SugarColumn(IsIgnore = true)]
    public List<BorCategory>? Children { get; set; }

    #region 扩展
    /// <summary>
    /// 扩展Id
    /// </summary>
    [SugarColumn(ColumnDescription = "扩展Id", IsNullable = true)]
    public string NavId { get; set; }

    /// <summary>
    /// 图标
    /// </summary>
    [SugarColumn(ColumnDescription = "图标", IsNullable = true)]
    public string Icon { get; set; } 
    #endregion
}
